\(\int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx\) [6]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 31 \[ \int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx=-\frac {4 \cos ^3(a+b x)}{3 b}+\frac {4 \cos ^5(a+b x)}{5 b} \]

[Out]

-4/3*cos(b*x+a)^3/b+4/5*cos(b*x+a)^5/b

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4373, 2645, 14} \[ \int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {4 \cos ^5(a+b x)}{5 b}-\frac {4 \cos ^3(a+b x)}{3 b} \]

[In]

Int[Sin[a + b*x]*Sin[2*a + 2*b*x]^2,x]

[Out]

(-4*Cos[a + b*x]^3)/(3*b) + (4*Cos[a + b*x]^5)/(5*b)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2645

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_.)*sin[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[-(a*f)^(-1), Subst[
Int[x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Cos[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2]
 &&  !(IntegerQ[(m - 1)/2] && GtQ[m, 0] && LeQ[m, n])

Rule 4373

Int[((f_.)*sin[(a_.) + (b_.)*(x_)])^(n_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/f^p, Int[Cos[a
+ b*x]^p*(f*Sin[a + b*x])^(n + p), x], x] /; FreeQ[{a, b, c, d, f, n}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = 4 \int \cos ^2(a+b x) \sin ^3(a+b x) \, dx \\ & = -\frac {4 \text {Subst}\left (\int x^2 \left (1-x^2\right ) \, dx,x,\cos (a+b x)\right )}{b} \\ & = -\frac {4 \text {Subst}\left (\int \left (x^2-x^4\right ) \, dx,x,\cos (a+b x)\right )}{b} \\ & = -\frac {4 \cos ^3(a+b x)}{3 b}+\frac {4 \cos ^5(a+b x)}{5 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.87 \[ \int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {2 \cos ^3(a+b x) (-7+3 \cos (2 (a+b x)))}{15 b} \]

[In]

Integrate[Sin[a + b*x]*Sin[2*a + 2*b*x]^2,x]

[Out]

(2*Cos[a + b*x]^3*(-7 + 3*Cos[2*(a + b*x)]))/(15*b)

Maple [A] (verified)

Time = 0.54 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.32

method result size
default \(-\frac {\cos \left (x b +a \right )}{2 b}-\frac {\cos \left (3 x b +3 a \right )}{12 b}+\frac {\cos \left (5 x b +5 a \right )}{20 b}\) \(41\)
risch \(-\frac {\cos \left (x b +a \right )}{2 b}-\frac {\cos \left (3 x b +3 a \right )}{12 b}+\frac {\cos \left (5 x b +5 a \right )}{20 b}\) \(41\)
parallelrisch \(\frac {\frac {4 \left (4 \tan \left (x b +a \right )^{4}+7 \tan \left (x b +a \right )^{2}+4\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}}{15}+\frac {16 \left (\tan \left (x b +a \right )^{3}-\tan \left (x b +a \right )\right ) \tan \left (\frac {a}{2}+\frac {x b}{2}\right )}{15}+\frac {4 \tan \left (x b +a \right )^{2}}{15}}{b \left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right ) \left (1+\tan \left (x b +a \right )^{2}\right )^{2}}\) \(104\)
norman \(\frac {-\frac {16}{15 b}-\frac {16 \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (x b +a \right )}{15 b}+\frac {16 \tan \left (\frac {a}{2}+\frac {x b}{2}\right ) \tan \left (x b +a \right )^{3}}{15 b}-\frac {16 \tan \left (x b +a \right )^{4}}{15 b}-\frac {28 \tan \left (x b +a \right )^{2}}{15 b}-\frac {4 \tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2} \tan \left (x b +a \right )^{2}}{15 b}}{\left (1+\tan \left (\frac {a}{2}+\frac {x b}{2}\right )^{2}\right ) \left (1+\tan \left (x b +a \right )^{2}\right )^{2}}\) \(127\)

[In]

int(sin(b*x+a)*sin(2*b*x+2*a)^2,x,method=_RETURNVERBOSE)

[Out]

-1/2*cos(b*x+a)/b-1/12*cos(3*b*x+3*a)/b+1/20*cos(5*b*x+5*a)/b

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.84 \[ \int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {4 \, {\left (3 \, \cos \left (b x + a\right )^{5} - 5 \, \cos \left (b x + a\right )^{3}\right )}}{15 \, b} \]

[In]

integrate(sin(b*x+a)*sin(2*b*x+2*a)^2,x, algorithm="fricas")

[Out]

4/15*(3*cos(b*x + a)^5 - 5*cos(b*x + a)^3)/b

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (26) = 52\).

Time = 0.36 (sec) , antiderivative size = 92, normalized size of antiderivative = 2.97 \[ \int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx=\begin {cases} - \frac {4 \sin {\left (a + b x \right )} \sin {\left (2 a + 2 b x \right )} \cos {\left (2 a + 2 b x \right )}}{15 b} - \frac {7 \sin ^{2}{\left (2 a + 2 b x \right )} \cos {\left (a + b x \right )}}{15 b} - \frac {8 \cos {\left (a + b x \right )} \cos ^{2}{\left (2 a + 2 b x \right )}}{15 b} & \text {for}\: b \neq 0 \\x \sin {\left (a \right )} \sin ^{2}{\left (2 a \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(sin(b*x+a)*sin(2*b*x+2*a)**2,x)

[Out]

Piecewise((-4*sin(a + b*x)*sin(2*a + 2*b*x)*cos(2*a + 2*b*x)/(15*b) - 7*sin(2*a + 2*b*x)**2*cos(a + b*x)/(15*b
) - 8*cos(a + b*x)*cos(2*a + 2*b*x)**2/(15*b), Ne(b, 0)), (x*sin(a)*sin(2*a)**2, True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.16 \[ \int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {3 \, \cos \left (5 \, b x + 5 \, a\right ) - 5 \, \cos \left (3 \, b x + 3 \, a\right ) - 30 \, \cos \left (b x + a\right )}{60 \, b} \]

[In]

integrate(sin(b*x+a)*sin(2*b*x+2*a)^2,x, algorithm="maxima")

[Out]

1/60*(3*cos(5*b*x + 5*a) - 5*cos(3*b*x + 3*a) - 30*cos(b*x + a))/b

Giac [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 36, normalized size of antiderivative = 1.16 \[ \int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx=\frac {3 \, \cos \left (5 \, b x + 5 \, a\right ) - 5 \, \cos \left (3 \, b x + 3 \, a\right ) - 30 \, \cos \left (b x + a\right )}{60 \, b} \]

[In]

integrate(sin(b*x+a)*sin(2*b*x+2*a)^2,x, algorithm="giac")

[Out]

1/60*(3*cos(5*b*x + 5*a) - 5*cos(3*b*x + 3*a) - 30*cos(b*x + a))/b

Mupad [B] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.84 \[ \int \sin (a+b x) \sin ^2(2 a+2 b x) \, dx=-\frac {4\,\left (5\,{\cos \left (a+b\,x\right )}^3-3\,{\cos \left (a+b\,x\right )}^5\right )}{15\,b} \]

[In]

int(sin(a + b*x)*sin(2*a + 2*b*x)^2,x)

[Out]

-(4*(5*cos(a + b*x)^3 - 3*cos(a + b*x)^5))/(15*b)